Optimal. Leaf size=77 \[ -\frac {a^2 \tanh ^{-1}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{b^{5/2} \sqrt {a+b} d}+\frac {(a-b) \cos (c+d x)}{b^2 d}+\frac {\cos ^3(c+d x)}{3 b d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 77, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3265, 398, 214}
\begin {gather*} -\frac {a^2 \tanh ^{-1}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{b^{5/2} d \sqrt {a+b}}+\frac {(a-b) \cos (c+d x)}{b^2 d}+\frac {\cos ^3(c+d x)}{3 b d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 214
Rule 398
Rule 3265
Rubi steps
\begin {align*} \int \frac {\sin ^5(c+d x)}{a+b \sin ^2(c+d x)} \, dx &=-\frac {\text {Subst}\left (\int \frac {\left (1-x^2\right )^2}{a+b-b x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {\text {Subst}\left (\int \left (-\frac {a-b}{b^2}-\frac {x^2}{b}+\frac {a^2}{b^2 \left (a+b-b x^2\right )}\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=\frac {(a-b) \cos (c+d x)}{b^2 d}+\frac {\cos ^3(c+d x)}{3 b d}-\frac {a^2 \text {Subst}\left (\int \frac {1}{a+b-b x^2} \, dx,x,\cos (c+d x)\right )}{b^2 d}\\ &=-\frac {a^2 \tanh ^{-1}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{b^{5/2} \sqrt {a+b} d}+\frac {(a-b) \cos (c+d x)}{b^2 d}+\frac {\cos ^3(c+d x)}{3 b d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.34, size = 150, normalized size = 1.95 \begin {gather*} \frac {6 a^2 \tan ^{-1}\left (\frac {\sqrt {b}-i \sqrt {a} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a-b}}\right )+6 a^2 \tan ^{-1}\left (\frac {\sqrt {b}+i \sqrt {a} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a-b}}\right )+\sqrt {-a-b} \sqrt {b} \cos (c+d x) (6 a-5 b+b \cos (2 (c+d x)))}{6 \sqrt {-a-b} b^{5/2} d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.27, size = 70, normalized size = 0.91
method | result | size |
derivativedivides | \(\frac {\frac {\frac {\left (\cos ^{3}\left (d x +c \right )\right ) b}{3}+a \cos \left (d x +c \right )-b \cos \left (d x +c \right )}{b^{2}}-\frac {a^{2} \arctanh \left (\frac {b \cos \left (d x +c \right )}{\sqrt {\left (a +b \right ) b}}\right )}{b^{2} \sqrt {\left (a +b \right ) b}}}{d}\) | \(70\) |
default | \(\frac {\frac {\frac {\left (\cos ^{3}\left (d x +c \right )\right ) b}{3}+a \cos \left (d x +c \right )-b \cos \left (d x +c \right )}{b^{2}}-\frac {a^{2} \arctanh \left (\frac {b \cos \left (d x +c \right )}{\sqrt {\left (a +b \right ) b}}\right )}{b^{2} \sqrt {\left (a +b \right ) b}}}{d}\) | \(70\) |
risch | \(\frac {a \,{\mathrm e}^{i \left (d x +c \right )}}{2 b^{2} d}-\frac {3 \,{\mathrm e}^{i \left (d x +c \right )}}{8 b d}+\frac {a \,{\mathrm e}^{-i \left (d x +c \right )}}{2 b^{2} d}-\frac {3 \,{\mathrm e}^{-i \left (d x +c \right )}}{8 b d}+\frac {i a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i \left (a +b \right ) {\mathrm e}^{i \left (d x +c \right )}}{\sqrt {-a b -b^{2}}}+1\right )}{2 \sqrt {-a b -b^{2}}\, d \,b^{2}}-\frac {i a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i \left (a +b \right ) {\mathrm e}^{i \left (d x +c \right )}}{\sqrt {-a b -b^{2}}}+1\right )}{2 \sqrt {-a b -b^{2}}\, d \,b^{2}}+\frac {\cos \left (3 d x +3 c \right )}{12 d b}\) | \(215\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 88, normalized size = 1.14 \begin {gather*} \frac {\frac {3 \, a^{2} \log \left (\frac {b \cos \left (d x + c\right ) - \sqrt {{\left (a + b\right )} b}}{b \cos \left (d x + c\right ) + \sqrt {{\left (a + b\right )} b}}\right )}{\sqrt {{\left (a + b\right )} b} b^{2}} + \frac {2 \, {\left (b \cos \left (d x + c\right )^{3} + 3 \, {\left (a - b\right )} \cos \left (d x + c\right )\right )}}{b^{2}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.41, size = 218, normalized size = 2.83 \begin {gather*} \left [\frac {2 \, {\left (a b^{2} + b^{3}\right )} \cos \left (d x + c\right )^{3} + 3 \, \sqrt {a b + b^{2}} a^{2} \log \left (-\frac {b \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a b + b^{2}} \cos \left (d x + c\right ) + a + b}{b \cos \left (d x + c\right )^{2} - a - b}\right ) + 6 \, {\left (a^{2} b - b^{3}\right )} \cos \left (d x + c\right )}{6 \, {\left (a b^{3} + b^{4}\right )} d}, \frac {{\left (a b^{2} + b^{3}\right )} \cos \left (d x + c\right )^{3} + 3 \, \sqrt {-a b - b^{2}} a^{2} \arctan \left (\frac {\sqrt {-a b - b^{2}} \cos \left (d x + c\right )}{a + b}\right ) + 3 \, {\left (a^{2} b - b^{3}\right )} \cos \left (d x + c\right )}{3 \, {\left (a b^{3} + b^{4}\right )} d}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 173 vs.
\(2 (67) = 134\).
time = 0.44, size = 173, normalized size = 2.25 \begin {gather*} \frac {\frac {3 \, a^{2} \arctan \left (\frac {b \cos \left (d x + c\right ) + a + b}{\sqrt {-a b - b^{2}} \cos \left (d x + c\right ) + \sqrt {-a b - b^{2}}}\right )}{\sqrt {-a b - b^{2}} b^{2}} - \frac {2 \, {\left (3 \, a - 2 \, b - \frac {6 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {6 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {3 \, a {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}}{b^{2} {\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1\right )}^{3}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.11, size = 72, normalized size = 0.94 \begin {gather*} \frac {\cos \left (c+d\,x\right )\,\left (\frac {a+b}{b^2}-\frac {2}{b}\right )}{d}+\frac {{\cos \left (c+d\,x\right )}^3}{3\,b\,d}-\frac {a^2\,\mathrm {atanh}\left (\frac {\sqrt {b}\,\cos \left (c+d\,x\right )}{\sqrt {a+b}}\right )}{b^{5/2}\,d\,\sqrt {a+b}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________